package cn.gorit.resource.config;

import org.mybatis.spring.annotation.MapperScan;
import org.mybatis.spring.mapper.MapperScannerConfigurer;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Configuration;

/**
 * @Classname MybatisMapperScannerConfig
 * @Description TODO
 * @Date 2021/3/21 16:40
 * @Created by CodingGorit
 * @Version 1.0
 */
@Configuration
@AutoConfigureAfter(MyBatisConfig.class)
@MapperScan({"cn.gorit.mapper.resource"})
public class MybatisMapperScannerConfig {
    public MapperScannerConfigurer mapperScannerConfigurer(){
        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
        mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
        mapperScannerConfigurer.setBasePackage("cn.gorit.mapper");
        return mapperScannerConfigurer;
    }
}
